/**
 * Copyright (C) 2012 The SkyTvOS Project
 * <p/>
 * Version     Date           Author
 * ─────────────────────────────────────
 * 2013-3-12         xingkong207
 */

package com.skyworth.tvos.skydom;

import org.w3c.dom.Document;

import java.io.File;
import java.util.ArrayList;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

/**
 * @author xingkong207
 * @version TODO (write something)
 * @ClassName SkyBaseDocment
 * @Description TODO (write something)
 * @date 2013-3-12
 */
public abstract class SkyBaseDocment {
    private DocumentBuilder docBuilder = null;
    protected Document mDoc = null;
    private String mFilename = null;

    public SkyBaseDocment() {
        try {
            docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public SkyBaseDocment(String filename) {
        try {
            docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            mDoc = docBuilder.parse(new File(filename));
            mFilename = filename;
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

    public abstract ArrayList<Object> getItemsByName(String name);
}
